#ifndef STX_ALGORITHM_IS_HEAP_HPP
#define STX_ALGORITHM_IS_HEAP_HPP

#include <stx/algorithm/common.hpp>
#include <stx/algorithm/is_heap_until.hpp>

namespace stx {

template <class RandomAccessIterator, class Compare>
inline bool
is_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp)
{
    return stx::is_heap_until(first, last, comp) == last;
}

template<class RandomAccessIterator>
inline bool
is_heap(RandomAccessIterator first, RandomAccessIterator last)
{
    return stx::is_heap(
        first,
        last,
        stx::less<typename std::iterator_traits<RandomAccessIterator>::value_type>());
}

} // namespace stx

#endif // STX_ALGORITHM_IS_HEAP_HPP
